import { Excel } from '@ttou/midway-excel'
import { Exclude } from 'class-transformer'

/**
 * 字典类型导出序列化
 */
export class DictTypeExportSerialize implements ISysDictTypeEntity {
  @Excel({ header: '字典编号' })
  dictId: string

  @Excel({ header: '字典名称' })
  dictName: string

  @Excel({ header: '字典类型' })
  dictType: string

  @Excel({ header: '状态' })
  status: string

  @Exclude()
  createBy: string

  @Excel({ header: '创建时间' })
  createTime: Date

  @Exclude()
  updateBy: string

  @Exclude()
  updateTime: Date

  @Excel({ header: '备注' })
  remark: string

  constructor(partial: any) {
    Object.assign(this, partial)
  }
}

/**
 * 字典数据导出序列化
 */
export class DictDataExportSerialize implements ISysDictDataEntity {
  @Excel({ header: '字典编码' })
  dictCode: string

  @Excel({ header: '字典排序' })
  dictSort: number

  @Excel({ header: '字典标签' })
  dictLabel: string

  @Excel({ header: '字典键值' })
  dictValue: string

  @Exclude()
  dictType: string

  @Exclude()
  isDefault: string

  @Excel({ header: '状态' })
  status: string

  @Exclude()
  createBy: string

  @Excel({ header: '创建时间' })
  createTime: Date

  @Exclude()
  updateBy: string

  @Exclude()
  updateTime: Date

  @Excel({ header: '备注' })
  remark: string

  constructor(partial: any) {
    Object.assign(this, partial)
  }
}
